package com.littlec.sdk.manager;

import org.jivesoftware.smack.AbstractConnectionListener;

import com.littlec.sdk.utils.CMChatListener;

public class CMAbstractConnectionListener extends AbstractConnectionListener {
	private CMChatListener.OnConnectionListener listener;

	public CMAbstractConnectionListener(
			CMChatListener.OnConnectionListener listener) {
		this.listener = listener;
	}

	public void connectionClosed() {
		super.connectionClosed();
	}

	public void connectionClosedOnError(Exception e) {
		super.connectionClosedOnError(e);
	}

	public void reconnectionSuccessful() {
		super.reconnectionSuccessful();
	}

	public int hashCode() {
		int prime = 31;
		int result = 1;
		result = 31 * result
				+ (this.listener == null ? 0 : this.listener.hashCode());
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof CMAbstractConnectionListener)) {
			return false;
		}
		CMAbstractConnectionListener other = (CMAbstractConnectionListener) obj;
		if (this.listener == null) {
			if (other.listener != null) {
				return false;
			}
		} else if (!this.listener.equals(other.listener)) {
			return false;
		}
		return true;
	}
}
